package com.yijia.work5.question5;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class Question5Servlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        System.out.println("收到请求！");
        Question5Bean question5Bean = new Question5Bean();

        String imagePath = question5Bean.showXkImage();

        request.setAttribute("imagePath", imagePath);
        request.getRequestDispatcher("/work5/5.jsp").forward(request, response);

    }

}
